﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Collections;

namespace Web.group
{
    public partial class BranchOfficeAdd : PageBase
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void btn_save_Click(object sender, EventArgs e)
        {
            Hashtable user = PhoneBook.Users.Users.get(Commons.StrUtil.FormatValue(Session["userid"]));

            if (string.IsNullOrEmpty(txbboname.Text.Trim()))
            {
                Helper.ShowMessage(u_message, controls.UCMessageType.error, "请填写分公司名称");
                return;
            }

            Hashtable newbo = new Hashtable();
            newbo["boname"] = txbboname.Text.Trim();
            newbo["groupid"] = user["groupid"];

            PhoneBook.Group.BranchOffice.add(newbo);

            AddLog("新添加了分公司：{0};", newbo["boname"]);
            Helper.ShowMessage(u_message, controls.UCMessageType.success, "保存成功");
        }
    }
}